import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.12

ApplicationWindow {
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    //&为首字母加下划线
    Action{
        id:actionNew
        text: "&New"
        shortcut: StandardKey.New//快捷键
        onTriggered: { //触发
            area.placeholderText = "To do -New"
        }
    }

    Action{
        id:actionOpen
        text: "&Open"
        shortcut: StandardKey.Open//快捷键
        onTriggered: { //触发
            area.placeholderText = "To do -Open"
        }
    }

    Action{
        id:actionSave
        text: "Save"
        shortcut: StandardKey.Save//快捷键
        onTriggered: { //触发
            area.placeholderText = "To do -Save"
        }
    }

    menuBar: MenuBar{

        Menu{
            title:"file"
            MenuItem{action: actionNew}
            MenuItem{action: actionOpen}
            MenuItem{action: actionSave}
        }
    }

    header:ToolBar{

       RowLayout{
           ToolButton{action:actionNew }
           ToolButton{action:actionOpen }
           ToolButton{action:actionSave }
       }

    }

    TextArea{
        id:area
        anchors.fill: parent//填满
    }
}
